﻿using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Linq.Expressions;
using System.Reactive.Concurrency;
using System.Reactive.Joins;

namespace System.Reactive.Linq
{
	public static partial class Qbservable
	{
		public static IQbservable<TSource> Take<TSource>(this IQbservable<TSource> source, int count)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Ensures(Contract.Result<IQbservable<TSource>>() != null, null, "Contract.Result<IQbservable<TSource>>() != null");
			return null;
		}

		public static IQbservable<TSource> Take<TSource>(this IQbservable<TSource> source, int count, IScheduler scheduler)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(scheduler != null, null, "scheduler != null");
			Contract.Ensures(Contract.Result<IQbservable<TSource>>() != null, null, "Contract.Result<IQbservable<TSource>>() != null");
			return null;
		}

		public static IQbservable<TSource> TakeLast<TSource>(this IQbservable<TSource> source, int count)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Ensures(Contract.Result<IQbservable<TSource>>() != null, null, "Contract.Result<IQbservable<TSource>>() != null");
			return null;
		}

		public static IQbservable<TSource> TakeUntil<TSource, TOther>(this IQbservable<TSource> source, IObservable<TOther> other)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(other != null, null, "other != null");
			Contract.Ensures(Contract.Result<IQbservable<TSource>>() != null, null, "Contract.Result<IQbservable<TSource>>() != null");
			return null;
		}

		public static IQbservable<TSource> TakeWhile<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, bool>> predicate)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(predicate != null, null, "predicate != null");
			Contract.Ensures(Contract.Result<IQbservable<TSource>>() != null, null, "Contract.Result<IQbservable<TSource>>() != null");
			return null;
		}

		public static IQbservable<TSource> TakeWhile<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, int, bool>> predicate)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(predicate != null, null, "predicate != null");
			Contract.Ensures(Contract.Result<IQbservable<TSource>>() != null, null, "Contract.Result<IQbservable<TSource>>() != null");
			return null;
		}

		public static QueryablePlan<TResult> Then<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, TResult>> selector)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(selector != null, null, "selector != null");
			Contract.Ensures(Contract.Result<QueryablePlan<TResult>>() != null, null, "Contract.Result<QueryablePlan<TResult>>() != null");
			return null;
		}

		public static IQbservable<TSource> Throttle<TSource, TThrottle>(this IQbservable<TSource> source, Expression<Func<TSource, IObservable<TThrottle>>> throttleDurationSelector)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(throttleDurationSelector != null, null, "throttleDurationSelector != null");
			Contract.Ensures(Contract.Result<IQbservable<TSource>>() != null, null, "Contract.Result<IQbservable<TSource>>() != null");
			return null;
		}

		public static IQbservable<TSource> Throttle<TSource>(this IQbservable<TSource> source, TimeSpan dueTime)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Ensures(Contract.Result<IQbservable<TSource>>() != null, null, "Contract.Result<IQbservable<TSource>>() != null");
			return null;
		}

		public static IQbservable<TSource> Throttle<TSource>(this IQbservable<TSource> source, TimeSpan dueTime, IScheduler scheduler)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(scheduler != null, null, "scheduler != null");
			Contract.Ensures(Contract.Result<IQbservable<TSource>>() != null, null, "Contract.Result<IQbservable<TSource>>() != null");
			return null;
		}

		public static IQbservable<TResult> Throw<TResult>(this IQbservableProvider provider, Exception exception)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(exception != null, null, "exception != null");
			Contract.Ensures(Contract.Result<IQbservable<TResult>>() != null, null, "Contract.Result<IQbservable<TResult>>() != null");
			return null;
		}

		public static IQbservable<TResult> Throw<TResult>(this IQbservableProvider provider, Exception exception, IScheduler scheduler)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(exception != null, null, "exception != null");
			Contract.Requires(scheduler != null, null, "scheduler != null");
			Contract.Ensures(Contract.Result<IQbservable<TResult>>() != null, null, "Contract.Result<IQbservable<TResult>>() != null");
			return null;
		}

		public static IQbservable<TimeInterval<TSource>> TimeInterval<TSource>(this IQbservable<TSource> source)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Ensures(Contract.Result<IQbservable<TimeInterval<TSource>>>() != null, null, "Contract.Result<IQbservable<TimeInterval<TSource>>>() != null");
			return null;
		}

		public static IQbservable<TimeInterval<TSource>> TimeInterval<TSource>(this IQbservable<TSource> source, IScheduler scheduler)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(scheduler != null, null, "scheduler != null");
			Contract.Ensures(Contract.Result<IQbservable<TimeInterval<TSource>>>() != null, null, "Contract.Result<IQbservable<TimeInterval<TSource>>>() != null");
			return null;
		}

		public static IQbservable<TSource> Timeout<TSource>(this IQbservable<TSource> source, DateTimeOffset dueTime)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Ensures(Contract.Result<IQbservable<TSource>>() != null, null, "Contract.Result<IQbservable<TSource>>() != null");
			return null;
		}

		public static IQbservable<TSource> Timeout<TSource, TTimeout>(this IQbservable<TSource> source, Expression<Func<TSource, IObservable<TTimeout>>> timeoutDurationSelector)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(timeoutDurationSelector != null, null, "timeoutDurationSelector != null");
			Contract.Ensures(Contract.Result<IQbservable<TSource>>() != null, null, "Contract.Result<IQbservable<TSource>>() != null");
			return null;
		}

		public static IQbservable<TSource> Timeout<TSource>(this IQbservable<TSource> source, TimeSpan dueTime)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Ensures(Contract.Result<IQbservable<TSource>>() != null, null, "Contract.Result<IQbservable<TSource>>() != null");
			return null;
		}

		public static IQbservable<TSource> Timeout<TSource, TTimeout>(this IQbservable<TSource> source, Expression<Func<TSource, IObservable<TTimeout>>> timeoutDurationSelector, IObservable<TSource> other)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(timeoutDurationSelector != null, null, "timeoutDurationSelector != null");
			Contract.Requires(other != null, null, "other != null");
			Contract.Ensures(Contract.Result<IQbservable<TSource>>() != null, null, "Contract.Result<IQbservable<TSource>>() != null");
			return null;
		}

		public static IQbservable<TSource> Timeout<TSource, TTimeout>(this IQbservable<TSource> source, IObservable<TTimeout> firstTimeout, Expression<Func<TSource, IObservable<TTimeout>>> timeoutDurationSelector)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(firstTimeout != null, null, "firstTimeout != null");
			Contract.Requires(timeoutDurationSelector != null, null, "timeoutDurationSelector != null");
			Contract.Ensures(Contract.Result<IQbservable<TSource>>() != null, null, "Contract.Result<IQbservable<TSource>>() != null");
			return null;
		}

		public static IQbservable<TSource> Timeout<TSource>(this IQbservable<TSource> source, DateTimeOffset dueTime, IObservable<TSource> other)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(other != null, null, "other != null");
			Contract.Ensures(Contract.Result<IQbservable<TSource>>() != null, null, "Contract.Result<IQbservable<TSource>>() != null");
			return null;
		}

		public static IQbservable<TSource> Timeout<TSource>(this IQbservable<TSource> source, DateTimeOffset dueTime, IScheduler scheduler)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(scheduler != null, null, "scheduler != null");
			Contract.Ensures(Contract.Result<IQbservable<TSource>>() != null, null, "Contract.Result<IQbservable<TSource>>() != null");
			return null;
		}

		public static IQbservable<TSource> Timeout<TSource>(this IQbservable<TSource> source, TimeSpan dueTime, IQbservable<TSource> other)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(other != null, null, "other != null");
			Contract.Ensures(Contract.Result<IQbservable<TSource>>() != null, null, "Contract.Result<IQbservable<TSource>>() != null");
			return null;
		}

		public static IQbservable<TSource> Timeout<TSource>(this IQbservable<TSource> source, TimeSpan dueTime, IScheduler scheduler)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(scheduler != null, null, "scheduler != null");
			Contract.Ensures(Contract.Result<IQbservable<TSource>>() != null, null, "Contract.Result<IQbservable<TSource>>() != null");
			return null;
		}

		public static IQbservable<TSource> Timeout<TSource>(this IQbservable<TSource> source, DateTimeOffset dueTime, IObservable<TSource> other, IScheduler scheduler)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(other != null, null, "other != null");
			Contract.Requires(scheduler != null, null, "scheduler != null");
			Contract.Ensures(Contract.Result<IQbservable<TSource>>() != null, null, "Contract.Result<IQbservable<TSource>>() != null");
			return null;
		}

		public static IQbservable<TSource> Timeout<TSource, TTimeout>(this IQbservable<TSource> source, IObservable<TTimeout> firstTimeout, Expression<Func<TSource, IObservable<TTimeout>>> timeoutDurationSelector, IObservable<TSource> other)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(firstTimeout != null, null, "firstTimeout != null");
			Contract.Requires(timeoutDurationSelector != null, null, "timeoutDurationSelector != null");
			Contract.Requires(other != null, null, "other != null");
			Contract.Ensures(Contract.Result<IQbservable<TSource>>() != null, null, "Contract.Result<IQbservable<TSource>>() != null");
			return null;
		}

		public static IQbservable<TSource> Timeout<TSource>(this IQbservable<TSource> source, TimeSpan dueTime, IObservable<TSource> other, IScheduler scheduler)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(other != null, null, "other != null");
			Contract.Requires(scheduler != null, null, "scheduler != null");
			Contract.Ensures(Contract.Result<IQbservable<TSource>>() != null, null, "Contract.Result<IQbservable<TSource>>() != null");
			return null;
		}

		public static IQbservable<long> Timer(this IQbservableProvider provider, DateTimeOffset dueTime)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Ensures(Contract.Result<IQbservable<long>>() != null, null, "Contract.Result<IQbservable<long>>() != null");
			return null;
		}

		public static IQbservable<long> Timer(this IQbservableProvider provider, TimeSpan dueTime)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Ensures(Contract.Result<IQbservable<long>>() != null, null, "Contract.Result<IQbservable<long>>() != null");
			return null;
		}

		public static IQbservable<long> Timer(this IQbservableProvider provider, DateTimeOffset dueTime, IScheduler scheduler)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(scheduler != null, null, "scheduler != null");
			Contract.Ensures(Contract.Result<IQbservable<long>>() != null, null, "Contract.Result<IQbservable<long>>() != null");
			return null;
		}

		public static IQbservable<long> Timer(this IQbservableProvider provider, DateTimeOffset dueTime, TimeSpan period)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Ensures(Contract.Result<IQbservable<long>>() != null, null, "Contract.Result<IQbservable<long>>() != null");
			return null;
		}

		public static IQbservable<long> Timer(this IQbservableProvider provider, TimeSpan dueTime, IScheduler scheduler)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(scheduler != null, null, "scheduler != null");
			Contract.Ensures(Contract.Result<IQbservable<long>>() != null, null, "Contract.Result<IQbservable<long>>() != null");
			return null;
		}

		public static IQbservable<long> Timer(this IQbservableProvider provider, TimeSpan dueTime, TimeSpan period)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Ensures(Contract.Result<IQbservable<long>>() != null, null, "Contract.Result<IQbservable<long>>() != null");
			return null;
		}

		public static IQbservable<long> Timer(this IQbservableProvider provider, DateTimeOffset dueTime, TimeSpan period, IScheduler scheduler)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(scheduler != null, null, "scheduler != null");
			Contract.Ensures(Contract.Result<IQbservable<long>>() != null, null, "Contract.Result<IQbservable<long>>() != null");
			return null;
		}

		public static IQbservable<long> Timer(this IQbservableProvider provider, TimeSpan dueTime, TimeSpan period, IScheduler scheduler)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(scheduler != null, null, "scheduler != null");
			Contract.Ensures(Contract.Result<IQbservable<long>>() != null, null, "Contract.Result<IQbservable<long>>() != null");
			return null;
		}

		public static IQbservable<Timestamped<TSource>> Timestamp<TSource>(this IQbservable<TSource> source)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Ensures(Contract.Result<IQbservable<Timestamped<TSource>>>() != null, null, "Contract.Result<IQbservable<Timestamped<TSource>>>() != null");
			return null;
		}

		public static IQbservable<Timestamped<TSource>> Timestamp<TSource>(this IQbservable<TSource> source, IScheduler scheduler)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(scheduler != null, null, "scheduler != null");
			Contract.Ensures(Contract.Result<IQbservable<Timestamped<TSource>>>() != null, null, "Contract.Result<IQbservable<Timestamped<TSource>>>() != null");
			return null;
		}

		public static IQbservable<TSource[]> ToArray<TSource>(this IQbservable<TSource> source)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Ensures(Contract.Result<IQbservable<TSource[]>>() != null, null, "Contract.Result<IQbservable<TSource[]>>() != null");
			return null;
		}

		public static IQbservable<IDictionary<TKey, TSource>> ToDictionary<TSource, TKey>(this IQbservable<TSource> source, Expression<Func<TSource, TKey>> keySelector)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(keySelector != null, null, "keySelector != null");
			Contract.Ensures(Contract.Result<IQbservable<IDictionary<TKey, TSource>>>() != null, null, "Contract.Result<IQbservable<IDictionary<TKey, TSource>>>() != null");
			return null;
		}

		public static IQbservable<IDictionary<TKey, TElement>> ToDictionary<TSource, TKey, TElement>(this IQbservable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TSource, TElement>> elementSelector)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(keySelector != null, null, "keySelector != null");
			Contract.Requires(elementSelector != null, null, "elementSelector != null");
			Contract.Ensures(Contract.Result<IQbservable<IDictionary<TKey, TElement>>>() != null, null, "Contract.Result<IQbservable<IDictionary<TKey, TElement>>>() != null");
			return null;
		}

		public static IQbservable<IDictionary<TKey, TSource>> ToDictionary<TSource, TKey>(this IQbservable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IEqualityComparer<TKey> comparer)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(keySelector != null, null, "keySelector != null");
			Contract.Requires(comparer != null, null, "comparer != null");
			Contract.Ensures(Contract.Result<IQbservable<IDictionary<TKey, TSource>>>() != null, null, "Contract.Result<IQbservable<IDictionary<TKey, TSource>>>() != null");
			return null;
		}

		public static IQbservable<IDictionary<TKey, TElement>> ToDictionary<TSource, TKey, TElement>(this IQbservable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TSource, TElement>> elementSelector, IEqualityComparer<TKey> comparer)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(keySelector != null, null, "keySelector != null");
			Contract.Requires(elementSelector != null, null, "elementSelector != null");
			Contract.Requires(comparer != null, null, "comparer != null");
			Contract.Ensures(Contract.Result<IQbservable<IDictionary<TKey, TElement>>>() != null, null, "Contract.Result<IQbservable<IDictionary<TKey, TElement>>>() != null");
			return null;
		}

		public static IQbservable<IList<TSource>> ToList<TSource>(this IQbservable<TSource> source)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Ensures(Contract.Result<IQbservable<IList<TSource>>>() != null, null, "Contract.Result<IQbservable<IList<TSource>>>() != null");
			return null;
		}

		public static IQbservable<ILookup<TKey, TSource>> ToLookup<TSource, TKey>(this IQbservable<TSource> source, Expression<Func<TSource, TKey>> keySelector)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(keySelector != null, null, "keySelector != null");
			Contract.Ensures(Contract.Result<IQbservable<ILookup<TKey, TSource>>>() != null, null, "Contract.Result<IQbservable<ILookup<TKey, TSource>>>() != null");
			return null;
		}

		public static IQbservable<ILookup<TKey, TElement>> ToLookup<TSource, TKey, TElement>(this IQbservable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TSource, TElement>> elementSelector)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(keySelector != null, null, "keySelector != null");
			Contract.Requires(elementSelector != null, null, "elementSelector != null");
			Contract.Ensures(Contract.Result<IQbservable<ILookup<TKey, TElement>>>() != null, null, "Contract.Result<IQbservable<ILookup<TKey, TElement>>>() != null");
			return null;
		}

		public static IQbservable<ILookup<TKey, TSource>> ToLookup<TSource, TKey>(this IQbservable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IEqualityComparer<TKey> comparer)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(keySelector != null, null, "keySelector != null");
			Contract.Requires(comparer != null, null, "comparer != null");
			Contract.Ensures(Contract.Result<IQbservable<ILookup<TKey, TSource>>>() != null, null, "Contract.Result<IQbservable<ILookup<TKey, TSource>>>() != null");
			return null;
		}

		public static IQbservable<ILookup<TKey, TElement>> ToLookup<TSource, TKey, TElement>(this IQbservable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TSource, TElement>> elementSelector, IEqualityComparer<TKey> comparer)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(keySelector != null, null, "keySelector != null");
			Contract.Requires(elementSelector != null, null, "elementSelector != null");
			Contract.Requires(comparer != null, null, "comparer != null");
			Contract.Ensures(Contract.Result<IQbservable<ILookup<TKey, TElement>>>() != null, null, "Contract.Result<IQbservable<ILookup<TKey, TElement>>>() != null");
			return null;
		}

		public static IQbservable<TSource> ToObservable<TSource>(this IQbservableProvider provider, IEnumerable<TSource> source)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(source != null, null, "source != null");
			Contract.Ensures(Contract.Result<IQbservable<TSource>>() != null, null, "Contract.Result<IQbservable<TSource>>() != null");
			return null;
		}

		public static IQbservable<TSource> ToObservable<TSource>(this IQbservableProvider provider, IEnumerable<TSource> source, IScheduler scheduler)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(scheduler != null, null, "scheduler != null");
			Contract.Ensures(Contract.Result<IQbservable<TSource>>() != null, null, "Contract.Result<IQbservable<TSource>>() != null");
			return null;
		}

		public static IQbservable<TSource> ToQbservable<TSource>(this IQueryable<TSource> source)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Ensures(Contract.Result<IQbservable<TSource>>() != null, null, "Contract.Result<IQbservable<TSource>>() != null");
			return null;
		}

		public static IQbservable<TSource> ToQbservable<TSource>(this IQueryable<TSource> source, IScheduler scheduler)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(scheduler != null, null, "scheduler != null");
			Contract.Ensures(Contract.Result<IQbservable<TSource>>() != null, null, "Contract.Result<IQbservable<TSource>>() != null");
			return null;
		}

		public static IQueryable<TSource> ToQueryable<TSource>(this IQbservable<TSource> source)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Ensures(Contract.Result<IQueryable<TSource>>() != null, null, "Contract.Result<IQueryable<TSource>>() != null");
			return null;
		}
	}
}